package com.huantai.customer.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangpeipei
 * @date 2020/5/9 15:51
 */
@Api(tags = "Demo RESTFUL APIs")
@RestController
@Slf4j
public class HelloController {

    @GetMapping(value = "/hello")
    public String hello() {
        log.info("hello start ");

        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        log.info("hello end");
        return "hello";
    }

    @PostMapping(value = "/hello2")
    public String hello2() {
        log.info("hello2 start ");

//        try {
//            Thread.sleep(10000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }

        log.info("hello2 end ");
        return "hello2";
    }
}
